<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>增加用户</title>

    <link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
    <link rel="stylesheet" href="{% static 'css/register.css' %}">
</head>
<body class="signin">

<div class="signinpanel">
    <form action="" method="post" class="layui-form">
        {% csrf_token %}
        <p class="form-group">用户添加界面</p>

        <div class="form-group">
            <label class="control-label" for="username">姓名</label>
            <input type="text" class="form-control" id="name" name="name" required="required" placeholder="请输入姓名">
        </div>

        <div class="form-group">
            <label class="control-label" for="username">工号(自动生成 不可自选)</label>
            <input type="text" class="form-control" id="sid" name="sid" required="required" placeholder="{{ sid }}" readonly value = "{{ sid }}">
        </div>
        <br>
        <div class="form-group">
            <label class="control-label" for="username">密码</label>
            <input type="password" class="form-control" id="pwd" name="pwd" required="required" placeholder="请输入密码">
        </div>
        <br>

        <div class="form-group">
            <label class="control-label" for="username">用户类型</label>
            <select name = 'state' class = 'form-control' id = 'state'>
                {% for key,value in select_usertype.SELVALUE %}
                    <option value = '{{ key }}'>{{ value }}</option>
                {% endfor %}
            </select>
        </div>
        <br>

        <div class="form-group">
            <label class="control-label" for="username">学院：（校级管理员可忽略此项）</label>
            <select name = 'collegeId' class = 'form-control' id = 'collegeId'>
                {% for key,value in select_college.SELVALUE %}
                    <option value = '{{ key }}'>{{ value }}</option>
                {% endfor %}
            </select>
        </div>
        <br>

        <div class="form-group">
            <label class="control-label" for="username">班级（老师、管理员可忽略此项）</label>
            <select name = 'classId' class = 'form-control' id = 'classId'>
                {% for key,value in select_class.SELVALUE %}
                    <option value = '{{ key }}'>{{ value }}</option>
                {% endfor %}
            </select>
        </div>
        <br>

        <div class="form-group">

            <button type="submit" class="btn" id = 'btn'>创建用户
            </button>

        </div>
    </form>
</div>

{% if messages %}
    <script>
        {% for msg in messages %}
            alert('{{ msg.message }}');
        {% endfor %}
    </script>
{% endif %}
</body>
</html>